//index.js
//获取应用实例
const app = getApp()
const Pager = require('components/aotoo/core')



Pager({
  data: {
    form: {
      data: [
        {
          // title: '表单填写',
          input: [
            {type: 'text', id: 'ss', title: '真实姓名', placeholder: '请输入用户名'},
            {type: 'text', id: 'ss2', title: '用户名', value: '没什么大不了，死不就还好', readyonly: true, disabled: true},
            {type: 'switch', id: 'ss3', title: '是否修改用户名', color: '#FFD500', bindchange: 'switchAction'},
          ],
          itemClass: 'bg-fff content-border'
        },
        {
          input: [{type: 'text', id: 'aa', title: '表单填写', itemClass: 'icon-after-toggle flex-row-between-center', readyonly: true, disabled: true}],itemClass: 'bg-fff'
        },
        // {
        //   title: '表单填写',
        //   itemClass: 'icon-after-toggle flex-row-between-center bg-fff',
        // },
      ],
      listClass: 'input-container-default p-default'
    }
  },
  switchAction: function (e, param, inst) {
    const {inputData, profile} = param
    if (inputData.value == true) {
      inst.value('ss2', {
        // show: false
        readyonly: false,
        disabled: false,
      })
    } else {
      inst.value('ss2', {
        readyonly: true,
        disabled: true,
      })
    }
  },
  onShow: function () {},
  onReady: function () {},
  onLoad: function () {},
})
